package Threads.CAS;

public class Account_With_MyAtomicInteger implements Account{
    MyAtomiacInteger integer=new MyAtomiacInteger(10000);

    @Override
    public Integer getBalance() {
        return integer.get();
    }

    @Override
    public void withdraw(Integer amount) {
        integer.decrease(amount);
    }

    public static void main(String[] args) {
        Account.demo(new Account_With_MyAtomicInteger());
    }
}
